package com.xxx.data;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/19  15:45
 * @Copyright
 */
public class CalendarDome {
    public static void main(String[] args) throws ParseException {

        // m1();
        //m2();

        String s2 = "2021-08-19 15:27:33";
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date data = format.parse(s2);
        Calendar ints = Calendar.getInstance();


    }

    private static void m2() {
        Calendar ints = Calendar.getInstance();
        ints.set(Calendar.YEAR, 2008);
        ints.set(Calendar.MARCH, 8);
        ints.set(Calendar.DAY_OF_MONTH, 8);

        int year = ints.get(Calendar.YEAR);
        int moth = ints.get(Calendar.MARCH);
        int day = ints.get(Calendar.DAY_OF_MONTH);
        //加减
        ints.add(Calendar.YEAR,1);


        System.out.println(year + ","+moth+","+day);
    }

    private static void m1() {
        //日历类
        Calendar ints = Calendar.getInstance();
        System.out.println(ints);
        ints.get(Calendar.YEAR);
        ints.get(Calendar.MARCH);
        ints.get(Calendar.DAY_OF_MONTH);
        ints.get(Calendar.HOUR_OF_DAY);
        ints.get(Calendar.MINUTE);
        ints.get(Calendar.SECOND);
    }
}
